Skip to content

xbps-remove --clean-cache#661

Merged
Duncaen merged 3 commits intovoid-linux:masterfrom
Duncaen:xbps-remove-rpool-multithreaded
Feb 23, 2026
Merged

xbps-remove --clean-cache#661
Duncaen merged 3 commits intovoid-linux:masterfrom
Duncaen:xbps-remove-rpool-multithreaded

Conversation

@Duncaen
Copy link
Member

@Duncaen Duncaen commented Dec 7, 2025

No description provided.

Comment on lines 151 to 156
// XXX: same for the repository pool...
if (uninstalled) {
(void)xbps_pkgdb_get_pkg(xhp, "foo");
} else {
(void)xbps_rpool_get_pkg(xhp, "package-that-wont-exist-so-it-loads-all-repos");
}
Copy link

@domsim1 domsim1 Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to make xbps_pkgdb_init and xbps_rpool_init thread-safe with pthread_mutex_t? This would eliminate the need for workarounds and make lazy initialization work safely whether called from single-threaded or multithreaded code. The performance overhead should be negligible since the mutex is only contended during the initial load.

This would also help prevent similar issues.

Happy to take a stab at implementing this if you think it's worthwhile.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My plan was to remove the lazy initialization instead.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that too, although it will be a breaking API change. How is something like that normally coordinated?

@Duncaen Duncaen force-pushed the xbps-remove-rpool-multithreaded branch from f9cf682 to c4f11fa Compare February 23, 2026 22:04
@Duncaen Duncaen force-pushed the xbps-remove-rpool-multithreaded branch from c4f11fa to 39803ba Compare February 23, 2026 22:05
@Duncaen Duncaen merged commit 39803ba into void-linux:master Feb 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants